using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Threading;

namespace Universe.WCF.Behaviors
{
    public static class TrafficDefaultInfo
    {
        public static readonly TrafficStatistic 
            ClientStatistic = new TrafficStatistic(),
            ServerStatistic = new TrafficStatistic();

        static TrafficDefaultInfo()
        {
            TrafficStatisticConfiguration.Common.OnClient += OnClient;
            TrafficStatisticConfiguration.Common.OnServer += OnServer;
        }

        public static void BindToCommon()
        {
        }



        private static void OnServer(string action, long requests, long recieved, long sent)
        {
            ServerStatistic.Merge(action, requests, recieved, sent);
        }

        private static void OnClient(string action, long requests, long recieved, long sent)
        {
            ClientStatistic.Merge(action, requests, recieved, sent);
        }




    }
}